# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt


# roc_auc = auc(fpr,tpr) ###计算auc的值

lw = 2

plt.xticks([2,4,6,8,10],fontsize=20)
plt.yticks([0,10,20,30,40,50,60,70,80,90],fontsize=20)
plt.xlim([0.0,10])
plt.ylim([0, 90])

fpr_umdl=np.array([1,5,10])
tpr_umdl=np.array([18.5, 31.4, 37.6])
fpr_pul=np.array([1,5,10])
tpr_pul=np.array([30, 43.4, 48.5])
fpr_tj_aidl=np.array([1,5,10])
tpr_tj_aidl=np.array([44.3,59.6, 65])
fpr_ptgan=np.array([1,5,10])
tpr_ptgan=np.array([27.4 ,43.6 ,50.7])
fpr_spgan=np.array([1,5,10])
tpr_spgan=np.array([46.4, 62.3, 68])
fpr_hhl=np.array([1,5,10])
tpr_hhl=np.array([46.9, 61, 66.7])
fpr_arn=np.array([1,5,10])
tpr_arn=np.array([60.2, 73.9, 79.5])
fpr_dcr=np.array([1,5,10])
tpr_dcr=np.array([71.3, 78.4, 82.3])

plt.plot(fpr_umdl,tpr_umdl, 
         lw=lw, label='UMDL',marker='o')
plt.plot(fpr_pul,tpr_pul,
         lw=lw, label='PUL',marker='<')
plt.plot(fpr_tj_aidl,tpr_tj_aidl, 
         lw=lw, label='TJ-AIDL',marker='+')
plt.plot(fpr_ptgan,tpr_ptgan, 
	     lw=lw, label='PTGN',marker='h')
plt.plot(fpr_spgan,tpr_spgan, 
	     lw=lw, label='SPGAN',marker='1')
plt.plot(fpr_hhl,tpr_hhl, 
	     lw=lw, label='HHL',marker='s')
plt.plot(fpr_arn,tpr_arn, 
	     lw=lw, label='ARN',marker='>')
plt.plot(fpr_dcr,tpr_dcr, 
	     lw=lw, label='DCR',marker='*')

# plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--')

plt.xlabel('Rank score',fontsize=20)
plt.ylabel('Matching rate(%)',fontsize=20)
plt.title('Train on M and test on D',fontsize=20)
plt.legend(loc="lower right",fontsize=15,ncol=2)
plt.savefig('M-D', bbox_inches='tight')